package com.teacher.system.dao;

import com.teacher.system.entity.Teacher;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;


@Repository
public interface TeacherDao extends JpaRepository<Teacher, Long> {

    @Query(value = "select * from Teacher order by id", nativeQuery = true)
//    @Query(value = "select * from Teacher where teacherName like %?1%", nativeQuery = true)
    Page<Teacher> findNameLike(String name, PageRequest pageRequest);
}
